package com.jl.smartcard.ui.views.cmds;

import java.util.HashMap;
import java.util.Map;


public class CMDs2G implements Group{
	
	public final static String ID = "2: 2G CMDs";

	private final static Map<String, String> cmdsMode2G = new HashMap<String, String>();
	static {
		// 2G
		cmdsMode2G.put("SELECT FILE", "A0 A4 00 00 xx FILE");
		cmdsMode2G.put("STATUS", "A0 F2 00 00 LEN");
		cmdsMode2G.put("READ BINARY", "A0 B0 00 00 LEN");
		cmdsMode2G.put("UPDATE BINARY", "A0 D6 00 00 xx DATA");
		cmdsMode2G.put("READ RECORD", "A0 B2 RecNo Mode LEN");
		cmdsMode2G.put("UPDATE RECORD", "A0 DC RecNo Mode xx DATA");
		cmdsMode2G.put("SEEK", "A0 A2 00 Mode xx Pattern");
		cmdsMode2G.put("INCREASE", "A0 32 00 00 03 DATA");
		cmdsMode2G.put("VERIFY CHV", "A0 20 00 CHVNo 08 CHV");
		cmdsMode2G.put("CHANGE CHV", "A0 24 00 CHVNo 10 OldCHV NewCHV");
		cmdsMode2G.put("DISABLE CHV", "A0 26 00 01 08 CHV");
		cmdsMode2G.put("ENABLE CHV", "A0 28 00 01 08 CHV");
		cmdsMode2G.put("UNBLOCK CHV", "A0 2C 00 CHVNo 10 UK NewCHV");
		cmdsMode2G.put("INVALIDATE", "A0 04 00 00 00");
		cmdsMode2G.put("REHABILITATE", "A0 44 00 00 00");
		cmdsMode2G.put("RUN GSM ALGORITHM", "A0 88 00 00 10 RAND");
		cmdsMode2G.put("SLEEP", "A0 FA 00 00 00");
		cmdsMode2G.put("GET RESPONSE", "A0 C0 00 00 LEN");
		cmdsMode2G.put("TERMINAL PROFILE", "A0 10 00 00 xx DATA");
		cmdsMode2G.put("ENVELOPE", "A0 C2 00 00 xx DATA");
		cmdsMode2G.put("FETCH", "A0 12 00 00 LEN");
		cmdsMode2G.put("TERMINAL RESPONSE", "A0 14 00 00 xx DATA");

	}

	@Override
	public Map<String, String> getCMDs() {
		return cmdsMode2G;
	}

	@Override
	public String wrap(String cmd) {
		StringBuilder sb = new StringBuilder();
		sb.append("a('").append(cmd).append("');");
		return sb.toString();
	}

	@Override
	public String get(String key) {
		return cmdsMode2G.get(key);
	}

}
